<script>
	import mqttUtil from '@/mqtt/mqtt.js'
	const mqttll = new mqttUtil()
	import mqttConfig from "@/mqtt/mqttConfig.js"
	export default {
		onLaunch: function() {

			console.log('App Launch')
		},
		onShow: function() {
			mqttll.connect()
			// uni.$on('data_dakai', this.dakai)
			// uni.$on('data_xiping', this.xiping)
			uni.$on('data_pageChange', (res) => {
				let Value = JSON.parse(res.msg);
				let isNone = Object.keys(this.state.page.start)
				let action = this.state.page.start;
				uni.reLaunch({
					url: action[Value.action]
				})
			})

			console.log('App Show')
		},
		onHide: function() {
			console.log('App Hide')
		},
		methods: {
			// dakai(data) {
			// 	if (data.msg == '01') {
			// 		uni.reLaunch({
			// 			url: '/src/pages/airconditioning/airconditioning'
			// 		})
			// 	}
			// },
			// xiping(data) {
			// 	if (data.msg == 02) {
			// 		uni.reLaunch({
			// 			url: 'pages/xiping'
			// 		})

			// 	}
			// }
		},
		data() {
			return {
				state: {
					page: {
						start: {
							'kongtiao': '/pages/airconditioning/airconditioning',
							"xiping": 'pages/xiping'
						}
					}
				}
			}
		}
	}
</script>

<style lang="scss">
	@import "uview-plus/index.scss";
	/*每个页面公共css */
</style>